package com.xdqzy.baseline.demo.service.impl;

import com.xdqzy.baseline.common.constant.CacheModuleConstants;
import com.xdqzy.baseline.common.manager.RedisCacheManager;
import com.xdqzy.baseline.demo.model.TProductClassifyModel;
import com.xdqzy.baseline.demo.mapper.TProductClassifyMapper;
import com.xdqzy.baseline.demo.service.TProductClassifyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * <p>
 * 分类表 服务实现类
 * </p>
 *
 * @author qss
 * @since 2020-10-27
 */
@Service
public class TProductClassifyServiceImpl extends ServiceImpl<TProductClassifyMapper, TProductClassifyModel> implements TProductClassifyService {

    @Resource
    private TProductClassifyService self;

    @Resource
    private RedisCacheManager redisCacheManager;

    @PostConstruct
    public void init() {
        redisCacheManager.registerLoader(CacheModuleConstants.PRODUCT_CLASSIFY, "ctbc:product:classify:", self::listByIds);
    }

}
